﻿<div class="project-map" id='mapDiv'>
  </div>

  <script type="text/javascript">

      $(window).load(function () {

          var map = GetMap(document.getElementById("mapDiv"), { center: new Microsoft.Maps.Location(-16.12, 45.6), zoom: 2 });
         
          var pushpinOptions = { draggable: true };
          var pushpin = new Microsoft.Maps.Pushpin(map.getCenter(), pushpinOptions);
          var pushpindragstart = Microsoft.Maps.Events.addHandler(pushpin, 'dragstart', startdragDetails);  
          map.entities.push(pushpin);
      });

      startdragDetails = function (e) {
          document.getElementById('Location').value = e.entity.getLocation();        
      }

  </script>